﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Windows;
using PSE.Framework.UI.Common;

namespace PSE.Framework.UI.Controls.SmartClient
{
    internal class ItemsSourceCollectionChangedEventManager : BaseWeakEventManager<ItemsSourceCollectionChangedEventManager, DataGrid, NotifyCollectionChangedEventArgs>
    {
        protected override void StartListening(object source)
        {
            DataGrid s = source as DataGrid;
            if (s != null)
                s.ItemsSourceCollectionChanged += new NotifyCollectionChangedEventHandler(HandleEvent);
        }

        protected override void StopListening(object source)
        {
            DataGrid s = source as DataGrid;
            if (s != null)
                s.ItemsSourceCollectionChanged -= new NotifyCollectionChangedEventHandler(HandleEvent);
        }
    }
}
